<?php
/* SVN FILE: $Id: sortArrays.php 118 2009-07-20 17:58:22Z supersmashbrothers $ */
/**
* ibMarket 2
* IP.Board 3.0
* ibMarket Sort functions
* ibMarket sorting comparison functions
*
* @author $Author: supersmashbrothers $
* @copyright $Copyright$
* @version $Revision: 118 $
* @lastrevision $Date: 2009-07-20 17:58:22 +0000 (Mon, 20 Jul 2009) $
* @modifiedby $LastChangedBy: supersmashbrothers $
* @lastmodified $LastChangedDate: 2009-07-20 17:58:22 +0000 (Mon, 20 Jul 2009) $
* @filesource $URL: http://ipb-ibmarket.googlecode.com/svn/ibmarket2/trunk/admin/applications_addon/other/ibmarket/sources/sortArrays.php $
*/

final class sortArrays
{
	/**
	 * Turn off constructor
	 *
	 * @access	private
	 * @return	void
	 */
	private function __construct() {}
	
	public static function orderCategory($a, $b)
	{
		if($a['cat_order'] > $b['cat_order'])
		{
			return 1;
		}
		elseif($a['cat_order'] < $b['cat_order'])
		{
			return -1;
		}
		$int = strcmp($a['cat_name'],$b['cat_name']);
		if($int)
		{
			return $int;
		}
		if($a['cat_id'] < $b['cat_id'])
		{
			return -1;
		}
		if($a['cat_id'] > $b['cat_id'])
		{
			return 1;
		}
		return 0; // Shouldn't be reached here.
	}
}
?>